home *** CD-ROM | disk | FTP | other *** search
/ Macworld Expo - Develope…Central & Net Innovations / Developer Central and Net Innovators (MacWorld Expo) (January 1999).iso / Developer Central / Bowers Development / Demo AppMaker / Examples / Pascal OS8 / Gadgets / DDocData.p < prev    next >
Encoding:
Text File  |  1998-10-30  |  10.9 KB  |  671 lines  |  [TEXT/CWIE]

  1. { DDocData.p -- data container class for Gadgets}
  2.  
  3. Unit DDocData;
  4. Interface
  5.  
  6. Uses
  7.     Types,
  8.     OSUtils,
  9.  
  10.  
  11.     AMSignaler;
  12.  
  13. const
  14.     idTriangle        = longint ('Trie');
  15.     idLeftRight        = longint ('Left');
  16.     idRadios        = longint ('Rads');
  17.     idBars        = longint ('Bars');
  18.     idStandard2        = longint ('Sta2');
  19.     idGraphic        = longint ('Grac');
  20.     idSlider        = longint ('Slir');
  21.     idTickMarks        = longint ('Tics');
  22.     idNonDirectional        = longint ('Nonl');
  23.     idLittleArrows        = longint ('Lits');
  24.     idSpinner        = longint ('Spir');
  25.     idVolumeControl        = longint ('Voll');
  26.     idJimSSlider        = longint ('Jimr');
  27.     idStandard3        = longint ('Sta3');
  28.     idIndeterminate        = longint ('Inde');
  29.     idChasingArrows        = longint ('Chas');
  30.     idRectangle        = longint ('Rece');
  31.     idRoundRect        = longint ('Rout');
  32.     idBarberPole        = longint ('Bare');
  33.     idRoundBarber        = longint ('Rour');
  34.     idSmall        = longint ('Smal');
  35.     idLarge        = longint ('Lare');
  36.     idX12345        = longint ('X145');
  37.     idX12345e6        = longint ('X126');
  38.     idPassword        = longint ('Pasd');
  39.     idTheDate        = longint ('Thee');
  40.     idTheTime        = longint ('Thee');
  41.     idStyled        = longint ('Styd');
  42.  
  43. type
  44.     {----------}
  45.     DDocData    = object (AMSignaler)
  46.  
  47.     {data members}
  48.         mTriangle:        Boolean;
  49.         mLeftRight:        Boolean;
  50.         mRadios:        SInt16;
  51.         mBars:        UInt16;
  52.         mStandard2:        SInt16;
  53.         mGraphic:        SInt16;
  54.         mSlider:        SInt16;
  55.         mTickMarks:        SInt16;
  56.         mNonDirectional:        SInt16;
  57.         mLittleArrows:        SInt16;
  58.         mSpinner:        SInt16;
  59.         mVolumeControl:        SInt16;
  60.         mJimSSlider:        SInt16;
  61.         mStandard3:        SInt16;
  62.         mIndeterminate:        SInt16;
  63.         mChasingArrows:        SInt16;
  64.         mRectangle:        SInt16;
  65.         mRoundRect:        SInt16;
  66.         mBarberPole:        SInt16;
  67.         mRoundBarber:        SInt16;
  68.         mSmall:        Str255;
  69.         mLarge:        Str255;
  70.         mX12345:        SInt32;
  71.         mX12345e6:        double;
  72.         mPassword:        Str255;
  73.         mTheDate:        LongDateRec;
  74.         mTheTime:        LongDateRec;
  75.         mStyled:        Str255;
  76.  
  77.     {methods}
  78.         Procedure Initialize; Override;
  79.  
  80.         Function  GetTriangle: Boolean;
  81.         Procedure SetTriangle    (inValue:        Boolean);
  82.         Function  GetLeftRight: Boolean;
  83.         Procedure SetLeftRight    (inValue:        Boolean);
  84.         Function  GetRadios: SInt16;
  85.         Procedure SetRadios    (inValue:        SInt16);
  86.         Function  GetBars: UInt16;
  87.         Procedure SetBars    (inValue:        UInt16);
  88.         Function  GetStandard2: SInt16;
  89.         Procedure SetStandard2    (inValue:        SInt16);
  90.         Function  GetGraphic: SInt16;
  91.         Procedure SetGraphic    (inValue:        SInt16);
  92.         Function  GetSlider: SInt16;
  93.         Procedure SetSlider    (inValue:        SInt16);
  94.         Function  GetTickMarks: SInt16;
  95.         Procedure SetTickMarks    (inValue:        SInt16);
  96.         Function  GetNonDirectional: SInt16;
  97.         Procedure SetNonDirectional    (inValue:        SInt16);
  98.         Function  GetLittleArrows: SInt16;
  99.         Procedure SetLittleArrows    (inValue:        SInt16);
  100.         Function  GetSpinner: SInt16;
  101.         Procedure SetSpinner    (inValue:        SInt16);
  102.         Function  GetVolumeControl: SInt16;
  103.         Procedure SetVolumeControl    (inValue:        SInt16);
  104.         Function  GetJimSSlider: SInt16;
  105.         Procedure SetJimSSlider    (inValue:        SInt16);
  106.         Function  GetStandard3: SInt16;
  107.         Procedure SetStandard3    (inValue:        SInt16);
  108.         Function  GetIndeterminate: SInt16;
  109.         Procedure SetIndeterminate    (inValue:        SInt16);
  110.         Function  GetChasingArrows: SInt16;
  111.         Procedure SetChasingArrows    (inValue:        SInt16);
  112.         Function  GetRectangle: SInt16;
  113.         Procedure SetRectangle    (inValue:        SInt16);
  114.         Function  GetRoundRect: SInt16;
  115.         Procedure SetRoundRect    (inValue:        SInt16);
  116.         Function  GetBarberPole: SInt16;
  117.         Procedure SetBarberPole    (inValue:        SInt16);
  118.         Function  GetRoundBarber: SInt16;
  119.         Procedure SetRoundBarber    (inValue:        SInt16);
  120.         Function  GetSmall: Str255;
  121.         Procedure SetSmall    (inValue:        Str255);
  122.         Function  GetLarge: Str255;
  123.         Procedure SetLarge    (inValue:        Str255);
  124.         Function  GetX12345: SInt32;
  125.         Procedure SetX12345    (inValue:        SInt32);
  126.         Function  GetX12345e6: double;
  127.         Procedure SetX12345e6    (inValue:        double);
  128.         Function  GetPassword: Str255;
  129.         Procedure SetPassword    (inValue:        Str255);
  130.         Function  GetTheDate: LongDateRec;
  131.         Procedure SetTheDate    (inValue:        LongDateRec);
  132.         Function  GetTheTime: LongDateRec;
  133.         Procedure SetTheTime    (inValue:        LongDateRec);
  134.         Function  GetStyled: Str255;
  135.         Procedure SetStyled    (inValue:        Str255);
  136.     end;
  137.  
  138. {----------}
  139. Function NewDDocData: DDocData;
  140.  
  141. {----------}
  142. Implementation
  143.  
  144. {----------}
  145. Function NewDDocData: DDocData;
  146. var
  147.     data:        DDocData;
  148. begin
  149.     data := nil;
  150.     New (data);
  151.     if data <> nil then begin
  152.         data.Initialize;
  153.     end;
  154.     NewDDocData := data;
  155. end;
  156.  
  157. {----------}
  158. Procedure DDocData.Initialize;
  159. begin
  160.     inherited Initialize;
  161.  
  162.     mTriangle := false;
  163.     mLeftRight := false;
  164.     mRadios := 0;
  165.     mBars := 0;
  166.     mStandard2 := 5;
  167.     mGraphic := 5;
  168.     mSlider := 5;
  169.     mTickMarks := 5;
  170.     mNonDirectional := 5;
  171.     mLittleArrows := 5;
  172.     mSpinner := 5;
  173.     mVolumeControl := 3;
  174.     mJimSSlider := 5;
  175.     mStandard3 := 5;
  176.     mIndeterminate := 5;
  177.     mChasingArrows := 5;
  178.     mRectangle := 5;
  179.     mRoundRect := 5;
  180.     mBarberPole := 5;
  181.     mRoundBarber := 5;
  182.     mSmall := 'small';
  183.     mLarge := 'large';
  184.     mX12345 := 0;
  185.     mX12345e6 := 0.0;
  186.     mPassword := 'password';
  187.     mTheDate.eraAlt := 0;
  188.     GetTime (mTheDate.oldDate);
  189.     mTheTime.eraAlt := 0;
  190.     GetTime (mTheTime.oldDate);
  191.     mStyled := 'styled';
  192. end;
  193.  
  194. {----------}
  195. Function DDocData.GetTriangle: Boolean;
  196. begin
  197.     GetTriangle := mTriangle;
  198.  
  199.  
  200. end;
  201.  
  202. Procedure DDocData.SetTriangle (
  203.     inValue:        Boolean);
  204. begin
  205.     mTriangle := inValue;
  206.  
  207.  
  208.     SignalDataChanged (idTriangle);
  209. end;
  210.  
  211. {----------}
  212. Function DDocData.GetLeftRight: Boolean;
  213. begin
  214.     GetLeftRight := mLeftRight;
  215.  
  216.  
  217. end;
  218.  
  219. Procedure DDocData.SetLeftRight (
  220.     inValue:        Boolean);
  221. begin
  222.     mLeftRight := inValue;
  223.  
  224.  
  225.     SignalDataChanged (idLeftRight);
  226. end;
  227.  
  228. {----------}
  229. Function DDocData.GetRadios: SInt16;
  230. begin
  231.     GetRadios := mRadios;
  232.  
  233.  
  234. end;
  235.  
  236. Procedure DDocData.SetRadios (
  237.     inValue:        SInt16);
  238. begin
  239.     mRadios := inValue;
  240.  
  241.  
  242.     SignalDataChanged (idRadios);
  243. end;
  244.  
  245. {----------}
  246. Function DDocData.GetBars: UInt16;
  247. begin
  248.     GetBars := mBars;
  249.  
  250.  
  251. end;
  252.  
  253. Procedure DDocData.SetBars (
  254.     inValue:        UInt16);
  255. begin
  256.     mBars := inValue;
  257.  
  258.  
  259.     SignalDataChanged (idBars);
  260. end;
  261.  
  262. {----------}
  263. Function DDocData.GetStandard2: SInt16;
  264. begin
  265.     GetStandard2 := mStandard2;
  266.  
  267.  
  268. end;
  269.  
  270. Procedure DDocData.SetStandard2 (
  271.     inValue:        SInt16);
  272. begin
  273.     mStandard2 := inValue;
  274.  
  275.  
  276.     SignalDataChanged (idStandard2);
  277. end;
  278.  
  279. {----------}
  280. Function DDocData.GetGraphic: SInt16;
  281. begin
  282.     GetGraphic := mGraphic;
  283.  
  284.  
  285. end;
  286.  
  287. Procedure DDocData.SetGraphic (
  288.     inValue:        SInt16);
  289. begin
  290.     mGraphic := inValue;
  291.  
  292.  
  293.     SignalDataChanged (idGraphic);
  294. end;
  295.  
  296. {----------}
  297. Function DDocData.GetSlider: SInt16;
  298. begin
  299.     GetSlider := mSlider;
  300.  
  301.  
  302. end;
  303.  
  304. Procedure DDocData.SetSlider (
  305.     inValue:        SInt16);
  306. begin
  307.     mSlider := inValue;
  308.  
  309.  
  310.     SignalDataChanged (idSlider);
  311. end;
  312.  
  313. {----------}
  314. Function DDocData.GetTickMarks: SInt16;
  315. begin
  316.     GetTickMarks := mTickMarks;
  317.  
  318.  
  319. end;
  320.  
  321. Procedure DDocData.SetTickMarks (
  322.     inValue:        SInt16);
  323. begin
  324.     mTickMarks := inValue;
  325.  
  326.  
  327.     SignalDataChanged (idTickMarks);
  328. end;
  329.  
  330. {----------}
  331. Function DDocData.GetNonDirectional: SInt16;
  332. begin
  333.     GetNonDirectional := mNonDirectional;
  334.  
  335.  
  336. end;
  337.  
  338. Procedure DDocData.SetNonDirectional (
  339.     inValue:        SInt16);
  340. begin
  341.     mNonDirectional := inValue;
  342.  
  343.  
  344.     SignalDataChanged (idNonDirectional);
  345. end;
  346.  
  347. {----------}
  348. Function DDocData.GetLittleArrows: SInt16;
  349. begin
  350.     GetLittleArrows := mLittleArrows;
  351.  
  352.  
  353. end;
  354.  
  355. Procedure DDocData.SetLittleArrows (
  356.     inValue:        SInt16);
  357. begin
  358.     mLittleArrows := inValue;
  359.  
  360.  
  361.     SignalDataChanged (idLittleArrows);
  362. end;
  363.  
  364. {----------}
  365. Function DDocData.GetSpinner: SInt16;
  366. begin
  367.     GetSpinner := mSpinner;
  368.  
  369.  
  370. end;
  371.  
  372. Procedure DDocData.SetSpinner (
  373.     inValue:        SInt16);
  374. begin
  375.     mSpinner := inValue;
  376.  
  377.  
  378.     SignalDataChanged (idSpinner);
  379. end;
  380.  
  381. {----------}
  382. Function DDocData.GetVolumeControl: SInt16;
  383. begin
  384.     GetVolumeControl := mVolumeControl;
  385.  
  386.  
  387. end;
  388.  
  389. Procedure DDocData.SetVolumeControl (
  390.     inValue:        SInt16);
  391. begin
  392.     mVolumeControl := inValue;
  393.  
  394.  
  395.     SignalDataChanged (idVolumeControl);
  396. end;
  397.  
  398. {----------}
  399. Function DDocData.GetJimSSlider: SInt16;
  400. begin
  401.     GetJimSSlider := mJimSSlider;
  402.  
  403.  
  404. end;
  405.  
  406. Procedure DDocData.SetJimSSlider (
  407.     inValue:        SInt16);
  408. begin
  409.     mJimSSlider := inValue;
  410.  
  411.  
  412.     SignalDataChanged (idJimSSlider);
  413. end;
  414.  
  415. {----------}
  416. Function DDocData.GetStandard3: SInt16;
  417. begin
  418.     GetStandard3 := mStandard3;
  419.  
  420.  
  421. end;
  422.  
  423. Procedure DDocData.SetStandard3 (
  424.     inValue:        SInt16);
  425. begin
  426.     mStandard3 := inValue;
  427.  
  428.  
  429.     SignalDataChanged (idStandard3);
  430. end;
  431.  
  432. {----------}
  433. Function DDocData.GetIndeterminate: SInt16;
  434. begin
  435.     GetIndeterminate := mIndeterminate;
  436.  
  437.  
  438. end;
  439.  
  440. Procedure DDocData.SetIndeterminate (
  441.     inValue:        SInt16);
  442. begin
  443.     mIndeterminate := inValue;
  444.  
  445.  
  446.     SignalDataChanged (idIndeterminate);
  447. end;
  448.  
  449. {----------}
  450. Function DDocData.GetChasingArrows: SInt16;
  451. begin
  452.     GetChasingArrows := mChasingArrows;
  453.  
  454.  
  455. end;
  456.  
  457. Procedure DDocData.SetChasingArrows (
  458.     inValue:        SInt16);
  459. begin
  460.     mChasingArrows := inValue;
  461.  
  462.  
  463.     SignalDataChanged (idChasingArrows);
  464. end;
  465.  
  466. {----------}
  467. Function DDocData.GetRectangle: SInt16;
  468. begin
  469.     GetRectangle := mRectangle;
  470.  
  471.  
  472. end;
  473.  
  474. Procedure DDocData.SetRectangle (
  475.     inValue:        SInt16);
  476. begin
  477.     mRectangle := inValue;
  478.  
  479.  
  480.     SignalDataChanged (idRectangle);
  481. end;
  482.  
  483. {----------}
  484. Function DDocData.GetRoundRect: SInt16;
  485. begin
  486.     GetRoundRect := mRoundRect;
  487.  
  488.  
  489. end;
  490.  
  491. Procedure DDocData.SetRoundRect (
  492.     inValue:        SInt16);
  493. begin
  494.     mRoundRect := inValue;
  495.  
  496.  
  497.     SignalDataChanged (idRoundRect);
  498. end;
  499.  
  500. {----------}
  501. Function DDocData.GetBarberPole: SInt16;
  502. begin
  503.     GetBarberPole := mBarberPole;
  504.  
  505.  
  506. end;
  507.  
  508. Procedure DDocData.SetBarberPole (
  509.     inValue:        SInt16);
  510. begin
  511.     mBarberPole := inValue;
  512.  
  513.  
  514.     SignalDataChanged (idBarberPole);
  515. end;
  516.  
  517. {----------}
  518. Function DDocData.GetRoundBarber: SInt16;
  519. begin
  520.     GetRoundBarber := mRoundBarber;
  521.  
  522.  
  523. end;
  524.  
  525. Procedure DDocData.SetRoundBarber (
  526.     inValue:        SInt16);
  527. begin
  528.     mRoundBarber := inValue;
  529.  
  530.  
  531.     SignalDataChanged (idRoundBarber);
  532. end;
  533.  
  534. {----------}
  535. Function DDocData.GetSmall: Str255;
  536. begin
  537.     GetSmall := mSmall;
  538.  
  539.  
  540. end;
  541.  
  542. Procedure DDocData.SetSmall (
  543.     inValue:        Str255);
  544. begin
  545.     mSmall := inValue;
  546.  
  547.  
  548.     SignalDataChanged (idSmall);
  549. end;
  550.  
  551. {----------}
  552. Function DDocData.GetLarge: Str255;
  553. begin
  554.     GetLarge := mLarge;
  555.  
  556.  
  557. end;
  558.  
  559. Procedure DDocData.SetLarge (
  560.     inValue:        Str255);
  561. begin
  562.     mLarge := inValue;
  563.  
  564.  
  565.     SignalDataChanged (idLarge);
  566. end;
  567.  
  568. {----------}
  569. Function DDocData.GetX12345: SInt32;
  570. begin
  571.     GetX12345 := mX12345;
  572.  
  573.  
  574. end;
  575.  
  576. Procedure DDocData.SetX12345 (
  577.     inValue:        SInt32);
  578. begin
  579.     mX12345 := inValue;
  580.  
  581.  
  582.     SignalDataChanged (idX12345);
  583. end;
  584.  
  585. {----------}
  586. Function DDocData.GetX12345e6: double;
  587. begin
  588.     GetX12345e6 := mX12345e6;
  589.  
  590.  
  591. end;
  592.  
  593. Procedure DDocData.SetX12345e6 (
  594.     inValue:        double);
  595. begin
  596.     mX12345e6 := inValue;
  597.  
  598.  
  599.     SignalDataChanged (idX12345e6);
  600. end;
  601.  
  602. {----------}
  603. Function DDocData.GetPassword: Str255;
  604. begin
  605.     GetPassword := mPassword;
  606.  
  607.  
  608. end;
  609.  
  610. Procedure DDocData.SetPassword (
  611.     inValue:        Str255);
  612. begin
  613.     mPassword := inValue;
  614.  
  615.  
  616.     SignalDataChanged (idPassword);
  617. end;
  618.  
  619. {----------}
  620. Function DDocData.GetTheDate: LongDateRec;
  621. begin
  622.     GetTheDate := mTheDate;
  623.  
  624.  
  625. end;
  626.  
  627. Procedure DDocData.SetTheDate (
  628.     inValue:        LongDateRec);
  629. begin
  630.     mTheDate := inValue;
  631.  
  632.  
  633.     SignalDataChanged (idTheDate);
  634. end;
  635.  
  636. {----------}
  637. Function DDocData.GetTheTime: LongDateRec;
  638. begin
  639.     GetTheTime := mTheTime;
  640.  
  641.  
  642. end;
  643.  
  644. Procedure DDocData.SetTheTime (
  645.     inValue:        LongDateRec);
  646. begin
  647.     mTheTime := inValue;
  648.  
  649.  
  650.     SignalDataChanged (idTheTime);
  651. end;
  652.  
  653. {----------}
  654. Function DDocData.GetStyled: Str255;
  655. begin
  656.     GetStyled := mStyled;
  657.  
  658.  
  659. end;
  660.  
  661. Procedure DDocData.SetStyled (
  662.     inValue:        Str255);
  663. begin
  664.     mStyled := inValue;
  665.  
  666.  
  667.     SignalDataChanged (idStyled);
  668. end;
  669.  
  670. end.
  671.